package com.foreverwin.mes.production.service.impl;

import com.foreverwin.mes.core.base.FrontPage;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.foreverwin.mes.production.model.CleanDataItem;
import com.foreverwin.mes.production.mapper.CleanDataItemMapper;
import com.foreverwin.mes.production.service.CleanDataItemService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
/**
 * <p>
 * 清洁主数据明细表 服务实现类
 * </p>
 *
 * @author Max
 * @since 2020-02-11
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class CleanDataItemServiceImpl extends ServiceImpl<CleanDataItemMapper, CleanDataItem> implements CleanDataItemService {


    @Autowired
    private CleanDataItemMapper cleanDataItemMapper;

    @Override
    public Page<CleanDataItem> selectPage(FrontPage<CleanDataItem> frontPage, CleanDataItem cleanDataItem) {
        EntityWrapper<CleanDataItem> queryWrapper = new EntityWrapper<>();
        queryWrapper.setEntity(cleanDataItem);
        return super.selectPage(frontPage.getPagePlus(), queryWrapper);
    }

    @Override
    public List<CleanDataItem> selectList(CleanDataItem cleanDataItem) {
        EntityWrapper<CleanDataItem> queryWrapper = new EntityWrapper<>();
        queryWrapper.setEntity(cleanDataItem);
        return super.selectList(queryWrapper);
    }

    /**
     * 根据外键查询清洁数据明细
     * @param zCleanDataBo 参数
     * @return List 返回值
     */
    @Override
    public List<CleanDataItem> getCleanDataItemByZCDBo(String zCleanDataBo) {
        return cleanDataItemMapper.selectCleanDataItemByZCDBo(zCleanDataBo);
    }


}